catalogUrl = 'http://testbedapps.sura.org/gi-cat/services/cswiso';
xsl        = 'xsl/sura.iso.xsl';
xml        = 'xml/suraISOQuery.xml';

mapCenterAndZoom = {
   lon  : -95
  ,lat  : 33
  ,zoom : 4
};

function buildFilter(limit,start) {
  var filters = [
    new OpenLayers.Filter.Comparison({
       type     : OpenLayers.Filter.Comparison.LIKE
      ,property : 'AnyText'
      ,value    : '*' + Ext.getCmp('anyTextSearchField').getValue() + '*'
    })
  ];
  var filter = new OpenLayers.Filter.Logical({
     type    : OpenLayers.Filter.Logical.AND
    ,filters : filters
  });

  var xml        = new OpenLayers.Format.XML();
  var filter_1_1 = new OpenLayers.Format.Filter({version: '1.1.0'});

  return [
     '<?xml version="1.0" encoding="UTF-8"?><csw:GetRecords xmlns:csw="http://www.opengis.net/cat/csw/2.0.2" xmlns:ogc="http://www.opengis.net/ogc" xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:apiso="http://www.opengis.net/cat/csw/apiso/1.0" xmlns:ows="http://www.opengis.net/ows" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:gml="http://www.opengis.net/gml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" service="CSW" version="2.0.2" resultType="results" outputFormat="application/xml"  xsi:schemaLocation="http://www.opengis.net/gml http://schemas.opengis.net/gml/3.2.1/gml.xsd http://www.opengis.net/cat/csw/2.0.2 http://schemas.opengis.net/csw/2.0.2/CSW-discovery.xsd" outputSchema="http://www.isotc211.org/2005/gmd" startPosition="' + start + '" maxRecords="' + limit + '"><csw:Query typeNames="gmd:MD_Metadata"><csw:ElementSetName typeNames="gmd:MD_Metadata">full</csw:ElementSetName><csw:Constraint version="1.1.0">'
    ,xml.write(filter_1_1.write(filter))
    ,'</csw:Constraint> </csw:Query> </csw:GetRecords>'
  ].join('');
}
